//
//  HNOrderConsultCell.m
//  baidaifu
//
//  Created by 朱传正 on 2017/1/19.
//  Copyright © 2017年 haoniu. All rights reserved.
//

#import "HNOrderConsultCell.h"

@implementation HNOrderConsultCell

-(void)changeNameSize:(NSString *)nameStr andState:(BOOL)isColor{
    
    CGFloat width = nameStr.length * 11;
    CGRect frame = _cellName.frame;
    frame.size.width = width;
    _cellName.frame = frame;
    
    _cellName.layer.masksToBounds = YES;
    _cellName.layer.cornerRadius = 2;
    if (isColor) {
        _cellName.backgroundColor = RGB(78, 205, 77);
    }
    
}

-(void)changeState:(NSInteger)state{
    if (state == 0) {
        [self.cellState setBackgroundColor:RGB(253, 128, 129)];
        [self.cellState setText:@"待付款"];
    }else if(state == 1){
        [self.cellState setBackgroundColor:RGB(140, 217, 138)];
        [self.cellState setText:@"已付款"];
    }else if(state == 31){
        [self.cellState setBackgroundColor:RGBJ(204)];
        [self.cellState setText:@"退款中"];
    }else if(state == 32){
        [self.cellState setBackgroundColor:RGBJ(223)];
        [self.cellState setText:@"已退款"];
    }else{
        [self.cellState setBackgroundColor:RGB(140, 217, 138)];
        [self.cellState setText:@"已付款"];
//        [self.cellState setHidden:YES];
    }
}



- (void)awakeFromNib {
    [super awakeFromNib];
    _cellImage.layer.masksToBounds = YES;
    _cellImage.layer.cornerRadius = _cellImage.frame.size.width/2;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
